import request from '@/utils/request'

/**
 * 获取部门列表
接口调用
 */
export const getDepartmentList = () => {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 新增部门
export const addDepartment = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据id查部门详情
export const getDetailById = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 根据id查部门详情 表单校验
export const updateDepartment = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 根据id删除部门
export const delDetailById = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
